Carbon


FSpDelete

Header: Files.h Carbon status: Supported

Deletes files and directories.

OSErr FSpDelete (
    const FSSpec *spec
);
spec

A pointer to an FSSpec structure specifying the file or directory to delete.

function result

A result code.

DISCUSSION

If the specified target is a file, both forks of the file are deleted. The file ID reference, if any, is removed.

A file must be closed before you can delete it. Similarly, a directory must be empty before you can delete it. If you attempt to delete an open file or a nonempty directory, FSpDelete returns the result code fBsyErr. FSpDelete also returns the result code fBsyErr if the directory has an open working directory associated with it.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)